package com.dalin.platform.loa.action;

import java.util.List;

import com.dalin.framework.action.StrutsTwoAction;
import com.dalin.platform.loa.LoaConst;
import com.dalin.platform.loa.service.WsSecurityService;

/*****************************************************************************
 * @content: 权限按钮                                                                                                                             *
 * @author : 那建林                                                                                                                                 *
 * @crtDate: 2010-03-02                                                     *
 ****************************************************************************/
public class LoaOperateManagerAction extends StrutsTwoAction {
	private Long menuId;
	private Long parentOperateId;
	private WsSecurityService wsSecurityService;
	
	public String execute() throws Exception {
		super.printInfo("", "===== this action begin");
		try {
			List rtnList = wsSecurityService
					.queryLoaOperates(getCurrentUser().getLum(), 
							menuId, getParentOperateId());
			if (rtnList.size() == 0) {
				setResContent(false, "对不起，您无权进行任何操作");
			} else {
				setResContent(true, rtnList);
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		super.printInfo("", "===== this action end");
		return null;
	}



	public Long getMenuId() {
		return menuId;
	}
	public void setMenuId(Long menuId) {
		this.menuId = menuId;
	}
	public Long getParentOperateId() {
		return parentOperateId == null ? LoaConst.BASE_PARENT_ID : parentOperateId;
	}

	public void setParentOperateId(Long parentOperateId) {
		this.parentOperateId = parentOperateId;
	}

	public WsSecurityService getWsSecurityService() {
		return wsSecurityService;
	}
	public void setWsSecurityService(WsSecurityService wsSecurityService) {
		this.wsSecurityService = wsSecurityService;
	}
}
